//
//  ChouViewController.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/3/2.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "ChouViewController.h"

#import "ChouCell.h"

@interface ChouViewController ()<UITableViewDelegate,UITableViewDataSource,UISearchBarDelegate>
@property(nonatomic,strong)UITableView *tableView;
@property(nonatomic,strong)UISearchBar *souSearchBar;
@end

@implementation ChouViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"我的认筹";
    self.view.backgroundColor = BgColor;
    _souSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 64, B_WIDTH, 44)];
    _souSearchBar.delegate = self;
    [_souSearchBar setPlaceholder:@"输入搜索内容"];
    [self.view addSubview:_souSearchBar];
    
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 108, B_WIDTH, B_HEIGHT-108) style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.rowHeight = 60;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableView];
    
    
    
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 16;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIndent = @"Cell";
    ChouCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIndent];
    if (!cell)
    {
        cell = [[ChouCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIndent];
        
    }
    [cell setSelectionStyle:UITableViewCellSelectionStyleNone];//取消点击
    return cell;
}


#pragma mark- 搜索的方法
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
}


#pragma mark- 关闭键盘
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [_souSearchBar resignFirstResponder];
    
    return YES;
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [_souSearchBar resignFirstResponder];
}










- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
